<%@ page contentType="text/html;charset=UTF-8"%>
<jsp:useBean id="pageBean" scope="request" class="com.agileai.hotweb.domain.PageBean"/>
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body {
    overflow: hidden;
}
#editor { 
    margin: 0;
    position: absolute;
    top:0;
    bottom: 0;
    left: 0;
    right: 0;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="js/jquery-1.7.1.js" language="javascript"></script>
<script src="js/util.js" language="javascript"></script>
<script src="aceditor/ace.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<pre id="editor">
</pre>
</body>
</html>
<script>
	var editor = ace.edit("editor");
	editor.setTheme("ace/theme/textmate");
	//editor.setTheme("ace/theme/twilight");
	editor.setKeyboardHandler("ace/keyboard/ace");
	editor.getSession().setMode("ace/mode/xml");
	editor.getSession().setNewLineMode("windows");
	editor.getSession().setUseWorker(true);
	editor.session.setUseSoftTabs(true);
	editor.setWrapBehavioursEnabled(false);
	editor.setHighlightSelectedWord(true); 

	var url = "<%=pageBean.getHandlerURL()%>&actionType=retrieveContent&WFP_ID=<%=pageBean.inputValue("WFP_ID")%>";
	sendRequest(url,{onComplete:function(responseText){
		editor.setValue(responseText);
	}});
</script>